﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Metriks.Parsiranje.Klase
{
    public class beginIf : LOC, Renameable
    {
        public String Izraz { get; set; }

        public beginIf(String[] parametri)
        {
            Izraz = parametri[0];
        }

        public override string ispiši()
        {
            return "if (" + Izraz + ") then";
        }

        public void renameVariable(string oldname, string newname)
        {
            Regex r = new Regex(@"\b" + oldname + @"\b");
            Izraz = r.Replace(Izraz, newname);
        }
    }
}
